package com.hivekion.common.entity;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class PagedResultVo<T> implements Serializable {

      private Integer pageSize;
      private Integer pageNum;
      private Double totalPage; // 总页数
      private Integer totalCount; // 总条数
      private List<T> data;

      public PagedResultVo() {
      }

      public PagedResultVo(SearchInputVo inputVo, Integer TotalCount, List<T> Data) {
	    this.pageNum = inputVo.getPageNum();
	    this.pageSize = inputVo.getPageSize();
	    this.totalCount = TotalCount;
	    this.totalPage = Math.ceil(TotalCount / inputVo.getPageSize());
	    this.data = Data;
      }
}
